<!DOCTYPE html>
<html lang="zh">
    <head></head>
    <body class="hold-transition sidebar-mini">
        <div class="wrapper">
            <nav class="main-header navbar navbar-expand bg-white navbar-light border-bottom"></nav>
            <aside class="main-sidebar sidebar-dark-primary elevation-4"></aside>
            <div class="content-wrapper">
                <div class="content-header">
                    <div class="container-fluid"></div>
                </div>
                <div id="content-panel" class="content">
                    <div class="container-fluid">
                        <div class="card card-primary card-outline">
                            <div class="card-header">
                                <h3 class="card-title">发布文章</h3>
                            </div>
                            <div class="card-body">
                                <form id="blogForm" onsubmit="return false;">
                                    <div class="form-group" style="display:flex;">
                                        <input type="hidden" id="blogId" name="blogId" value="-1">
                                        <input type="text" class="form-control col-sm-6" id="blogName" name="blogName"
                                               placeholder="*请输入文章标题(必填)" required="required"/>
                                        &nbsp;&nbsp;
                                        <select class="form-control select2" style="width: 100%;" id="blogCategoryId"
                                                data-placeholder="请选择分类...">
                                        </select>
                                    </div>
                                    <div class="form-group" id="blog-editormd">
                                        <textarea id="blogContentArea" style="display:none;"></textarea>
                                    </div>
                                    <div class="form-group">
                                        <!-- 按钮 -->
                                        &nbsp;<button class="btn btn-info float-right" style="margin-left: 5px;"
                                                      id="confirmButton" onclick="confirm()">保存文章
                                    </button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="content">
                    <div class="modal fade" id="articleModal" tabindex="-1" role="dialog"
                         aria-labelledby="articleModalLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h6 class="modal-title" id="articleModalLabel">信息完善</h6>
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                            aria-hidden="true">&times;</span></button>
                                </div>
                                <div class="modal-body">
                                    <form onsubmit="return false;">
                                        <div class="form-group">
                                            <label class="control-label">文章状态:&nbsp;</label>
                                            <input name="blogStatus" type="radio" id="publish"
                                                   checked="checked"
                                                   value="1"/>&nbsp;发布&nbsp;
                                            <input name="blogStatus" type="radio" id="draft" value="0"/>&nbsp;草稿&nbsp;
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label">是否允许评论:&nbsp;</label>
                                            <input name="enableComment" type="radio" id="enableCommentTrue"
                                                   checked="checked" value="0"/>&nbsp;是&nbsp;
                                            <input name="enableComment" type="radio" id="enableCommentFalse" value="1"/>&nbsp;否&nbsp;
                                        </div>
                                    </form>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                    <button type="button" class="btn btn-primary" id="saveButton" onclick="saveBlog()">
                                        确认
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <footer class="main-footer"></footer>
        </div>
        <script src="/admin/plugins/jquery.min.js"></script>

        <script src="/admin/plugins/jquery-ui.min.js"></script>
        <script src="/admin/plugins/js.cookie.min.js"></script>

        <script src="/admin/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>

        <script src="/admin/plugins/adminlte/adminlte.min.js"></script>

        <script src="/admin/plugins/editormd/editormd.min.js"></script>

        <script src="/admin/plugins/tagsinput/jquery.tagsinput.min.js"></script>

        <script src="/admin/plugins/select2/select2.full.min.js"></script>

        <script src="/admin/plugins/ajaxupload.js"></script>

        <script src="/admin/plugins/layer/layer.js"></script>

        <script src="/admin/dist/js/public.js"></script>
        <script src="/admin/dist/js/base.js"></script>

        <script>
            $(function () {
                // 加载head标签内容
                $("head").load("/admin/templates/head.html");
                $("nav").load("/admin/templates/navigation.html");
                $("aside").load("/admin/templates/sidebar.html", function () {
                    let name = Cookies.get("nickName");
                    $("#userNick").text(name);
                    clearActive();
                    $("#ul-item-2").attr("class", "nav-link active");
                });
                $("footer").load("/admin/templates/footer.html");
                newBlog();
            });
        </script>
    </body>
</html>